<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <title>个人中心</title>
    <style>
        body { background: #f5f5f5; font-family: 'Microsoft YaHei', Arial, sans-serif; margin: 0; }
        .navbar {
            background-color: #363636;
            overflow: hidden;
            padding: 10px 20px;
            display: flex;
            justify-content: flex-end;
            align-items: center;
        }
        .navbar a {
            color: #f2f2f2;
            text-align: center;
            padding: 14px 20px;
            text-decoration: none;
            font-size: 17px;
            transition: background-color 0.3s, color 0.3s;
        }
        .navbar a:hover, .navbar a.active {
            background-color: #555;
            color: white;
        }
        .container {
            width: 500px;
            margin: 50px auto;
            background: #fff;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            padding: 40px;
            text-align: center;
        }
        h2 { margin-bottom: 20px; color: #333; }
        .form-group {
            margin-bottom: 15px;
            text-align: left;
        }
        .form-group label {
            display: block;
            margin-bottom: 5px;
            color: #555;
        }
        .form-group input[type="text"],
        .form-group input[type="password"] {
            width: calc(100% - 20px);
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
        }
        .btn-submit {
            background: #007bff;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 4px;
            cursor: pointer;
            margin-top: 20px;
        }
        .btn-submit:hover { background: #0056b3; }
        .message { margin-top: 20px; padding: 10px; border-radius: 5px; }
        .success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
        .error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
    </style>
</head>
<body>
<div class="navbar">
    <a href="index.jsp">首页</a>
    <a href="xuesheng_course_selection">选课</a>
    <a href="xuesheng_course_records">选课记录</a>
    <a href="xuesheng_personal_center" class="active">个人中心</a>
    <a href="logout">退出登录</a>
</div>
<div class="container">
    <h2>个人中心</h2>
    <c:if test="${not empty errorMessage}">
        <p class="message error"><c:out value="${errorMessage}"/></p>
    </c:if>
    <c:if test="${not empty successMessage}">
        <p class="message success"><c:out value="${successMessage}"/></p>
    </c:if>
    <form action="xuesheng_personal_center" method="post">
        <div class="form-group">
            <label for="studentId">学号:</label>
            <input type="text" id="studentId" name="studentId" value="<c:out value="${student.studentId}"/>" readonly>
        </div>
        <div class="form-group">
            <label for="username">用户名:</label>
            <input type="text" id="username" name="username" value="<c:out value="${student.username}"/>" readonly>
        </div>
        <div class="form-group">
            <label for="studentName">姓名:</label>
            <input type="text" id="studentName" name="studentName" value="<c:out value="${student.name}"/>">
        </div>
        <div class="form-group">
            <label for="password">密码:</label>
            <input type="password" id="password" name="password" value="<c:out value="${student.password}"/>"> 
        </div>
        <div class="form-group">
            <label for="email">邮箱:</label>
            <input type="text" id="email" name="contactInfo" value="<c:out value="${student.email}"/>"> 
        </div>
        <div class="form-group">
            <label for="phone">电话:</label>
            <input type="text" id="phone" name="contactInfo" value="<c:out value="${student.phone}"/>"> 
        </div>
        <button type="submit" class="btn-submit">更新信息</button>
    </form>
</div>
</body>
</html> 